﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace BazaartBI
{
    public class FileUtils
    {   
        public IList<string> GetRows(string file)
        {
            var rows = new List<string>();
            using (var reader = new StreamReader(file))
            {
                while(reader.Peek() != -1)
                {
                    rows.Add(reader.ReadLine());
                }
            }
            return rows;
        }

        public void StoreBusiness(IEnumerable<FacebookInfo> businesses)
        {
            using (var writer = new StreamWriter("output.txt"))
            {
                foreach (var business in businesses)
                {
                    writer.WriteLine(business.ToString());
                }
            }
        }
    }
}
